package My.example.aop;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

@Component
@Aspect
public class yanaop {
    @Pointcut("execution(* My.example.service.impl.yanserimple.yyy1(..))")
    public void pt(){};

    @Around("pt()")
    public Object around(ProceedingJoinPoint pjp) throws Throwable{
        Object[] args=pjp.getArgs();
        for (int i=0;i<args.length;i++){
            if (args[i].getClass().equals(String.class)){
                args[i]=args[i].toString().trim();
            }
        }
        System.out.println("检测");
        Object result=pjp.proceed(args);

        return result;
    }
}
